package gwtmodule1.client.gui.shared;

import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;

import gwtmodule1.client.gui.utils.FormTable;

public class AccountForm extends FormTable {

	public AccountForm(int userID, boolean editRoles) {
		super();
		if (editRoles) {
			addSection("Roles");
			addInput("Is Admin", new CheckBox());
			addInput("Is Sales Manager", new CheckBox());
			addInput("Is Sales Staff", new CheckBox());
			addInput("Is Customer", new CheckBox());
		}
		addSection("Login Information");
		addInput("Login Name", new TextBox());
		addInput("Password", new PasswordTextBox());
		addInput("Password (confirm)", new PasswordTextBox());
		addInput("Email Address", new TextBox());
		addSection("Personal Information");
		addInput("First Name", new TextBox());
		addInput("Last Name", new TextBox());
		addInput("Phone", new TextBox());
		addAddress();
		if (userID != 0 || editRoles) {
			addSection("Payment information");
			addCreditCardNumber();
		}
		else {
			addSection("Industrial Customer");
			addInput("I am an Industrial Customer", new CheckBox());
		}
		if (userID != 0)
			addButton("Save", null);
		else
			addButton("Create Account", null);
	}
}
